# 本文件是绘图的尝试，不涉及重要代码
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

# 读取统计数据
def read_data():
    csv_path = 'D:/lung_cancer/data/suvmax2.csv'
    data = pd.read_csv(csv_path)
    return data

# 将某类数据按类别划分
def devide_data(data, cancer_type):
    x_list = [[],[],[],[],[]]
    for i in range(len(data)):
        x_list[cancer_type[i]-1].append(data[i])

    return x_list


def draw_box():
    data = read_data()
    suv_max = data['SUVMAX']
    suv_min = data['SUVMIN']
    suv_avg = data['SUVAVG']
    suv_std = data['SUVSTD']
    ct_r = data['ct_r_pix']
    cancer_type = data['cancer_type']

    x_suv_max=devide_data(ct_r, cancer_type)

    fig = plt.figure(figsize=(8, 6))

    plt.boxplot(x_suv_max, notch=False, sym='rs', vert=True, showmeans=True)

    plt.xticks([y + 1 for y in range(len(x_suv_max))], ['0', '1', '2', '3', '4'])
    plt.xlabel('measurement suvavg')
    t = plt.title('Box plot')
    plt.show()

if __name__ == '__main__':



    # draw_box()

    a = np.random.beta(2,2,30)
    print(a)